package com.godyao.mall.goods.es.model;

import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author godyao
 * @date 2022/4/5
 */
@Data
@Document(indexName = "goods", createIndex = true)
public class GoodsEs implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    private Long id;

    private Long goodsId;

    @Field(type = FieldType.Text)
    private String goodsName;

    @Field(type = FieldType.Text)
    private String goodsTitle;

    private String goodsImg;

    @Field(type = FieldType.Text)
    private String goodsDetail;

    @Field(type = FieldType.Double)
    private BigDecimal goodsPrice;

    private Integer goodsStock;

    @Field(type = FieldType.Date, format = {}, pattern = "uuuu/MM/dd HH:mm:ss")
    private Date createTime;

    @Field(type = FieldType.Date, format = {}, pattern = "uuuu/MM/dd HH:mm:ss")
    private Date updateTime;
}
